
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>六、进程与线程 · 计算机笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="海拉尔的三角">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro-fixed/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-ancre-navigation/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-insert-logo-link-website/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-auto-scroll-table/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-katex-pro/katex.min.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-terminull-light/terminull.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="locks_withNum.html" />
    
    
    <link rel="prev" href="memory_withNum.html" />
    

    
        <link rel="shortcut icon" href="image/ico.png" type="image/x-icon">
    
    
    
    
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="image/ico.png">
    
    
        
    
    
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://github.com/spite-triangle" target="_blank" class="custom-link">Github</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../cpp.html">
            
                <a href="../cpp.html">
            
                    
                    C/C++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="foundation_withNum.html">
            
                <a href="foundation_withNum.html">
            
                    
                    一、基础概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="keyword_withNum.html">
            
                <a href="keyword_withNum.html">
            
                    
                    二、关键字
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="point_reference_withNum.html">
            
                <a href="point_reference_withNum.html">
            
                    
                    三、指针与引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="oop_withNum.html">
            
                <a href="oop_withNum.html">
            
                    
                    四、面向对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="memory_withNum.html">
            
                <a href="memory_withNum.html">
            
                    
                    五、内存
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.1.6" data-path="process_withNum.html">
            
                <a href="process_withNum.html">
            
                    
                    六、进程与线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="locks_withNum.html">
            
                <a href="locks_withNum.html">
            
                    
                    七、锁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.8" data-path="stl_withNum.html">
            
                <a href="stl_withNum.html">
            
                    
                    八、STL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.9" data-path="dataStruction_withNum.html">
            
                <a href="dataStruction_withNum.html">
            
                    
                    九、数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.10" data-path="array_list_withNum.html">
            
                <a href="array_list_withNum.html">
            
                    
                    十、数组链表操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.11" data-path="find_withNum.html">
            
                <a href="find_withNum.html">
            
                    
                    十一、目标查找
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.12" data-path="tree_withNum.html">
            
                <a href="tree_withNum.html">
            
                    
                    十二、树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.13" data-path="binaryTree_withNum.html">
            
                <a href="binaryTree_withNum.html">
            
                    
                    十三、二叉树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.14" data-path="dynamicProgram_withNum.html">
            
                <a href="dynamicProgram_withNum.html">
            
                    
                    十四、动态规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.15" data-path="backtracking_withNum.html">
            
                <a href="backtracking_withNum.html">
            
                    
                    十五、回溯算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.16" data-path="monotoneStack_withNum.html">
            
                <a href="monotoneStack_withNum.html">
            
                    
                    十六、单调栈
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.17" data-path="toollib_withNum.html">
            
                <a href="toollib_withNum.html">
            
                    
                    附录 工具库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../../MySQL/mysql.html">
            
                <a href="../../MySQL/mysql.html">
            
                    
                    MySQL
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="../../MySQL/chapter/introduction_withNum.html">
            
                <a href="../../MySQL/chapter/introduction_withNum.html">
            
                    
                    一、简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="../../MySQL/chapter/foundation_withNum.html">
            
                <a href="../../MySQL/chapter/foundation_withNum.html">
            
                    
                    二、控制台操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="../../MySQL/chapter/operatorDB_withNum.html">
            
                <a href="../../MySQL/chapter/operatorDB_withNum.html">
            
                    
                    三、数据库、表操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.4" data-path="../../MySQL/chapter/operatorData_withNum.html">
            
                <a href="../../MySQL/chapter/operatorData_withNum.html">
            
                    
                    四、数据操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5" data-path="../../MySQL/chapter/transaction_withNum.html">
            
                <a href="../../MySQL/chapter/transaction_withNum.html">
            
                    
                    五、事务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6" data-path="../../MySQL/chapter/index_withNum.html">
            
                <a href="../../MySQL/chapter/index_withNum.html">
            
                    
                    六、索引
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.7" data-path="../../MySQL/chapter/authority_withNum.html">
            
                <a href="../../MySQL/chapter/authority_withNum.html">
            
                    
                    七、权限管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.8" data-path="../../MySQL/chapter/backup_withNum.html">
            
                <a href="../../MySQL/chapter/backup_withNum.html">
            
                    
                    八、备份
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../../linux/linux.html">
            
                <a href="../../linux/linux.html">
            
                    
                    Linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="../../linux/chapter/foundation_withNum.html">
            
                <a href="../../linux/chapter/foundation_withNum.html">
            
                    
                    一、原理知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="../../linux/chapter/command_withNum.html">
            
                <a href="../../linux/chapter/command_withNum.html">
            
                    
                    二、指令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../../tcp_udp/tcp_upd.html">
            
                <a href="../../tcp_udp/tcp_upd.html">
            
                    
                    网络
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="../../tcp_udp/chapter/foundation_withNum.html">
            
                <a href="../../tcp_udp/chapter/foundation_withNum.html">
            
                    
                    一、网络通讯基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2" data-path="../../tcp_udp/chapter/tcp_udp_withNum.html">
            
                <a href="../../tcp_udp/chapter/tcp_udp_withNum.html">
            
                    
                    二、tcp/udp
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >六、进程与线程</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><span class="title-icon "></span><a href="#&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;"><b></b>&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;</a></li><li><span class="title-icon "></span><a href="#1-&#x8FDB;&#x7A0B;"><b></b>1. &#x8FDB;&#x7A0B;</a></li><ul><li><span class="title-icon "></span><a href="#11-&#x7A0B;&#x5E8F;&#x64CD;&#x4F5C;"><b></b>1.1. &#x7A0B;&#x5E8F;&#x64CD;&#x4F5C;</a></li><ul><li><span class="title-icon "></span><a href="#111-&#x521B;&#x5EFA;"><b></b>1.1.1. &#x521B;&#x5EFA;</a></li><li><span class="title-icon "></span><a href="#112-&#x7EC8;&#x6B62;"><b></b>1.1.2. &#x7EC8;&#x6B62;</a></li><li><span class="title-icon "></span><a href="#113-&#x7B49;&#x5F85;"><b></b>1.1.3. &#x7B49;&#x5F85;</a></li><li><span class="title-icon "></span><a href="#114-&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x4FE1;&#x606F;status"><b></b>1.1.4. &#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x4FE1;&#x606F;status</a></li></ul><li><span class="title-icon "></span><a href="#12-&#x8FDB;&#x7A0B;&#x72B6;&#x6001;"><b></b>1.2. &#x8FDB;&#x7A0B;&#x72B6;&#x6001;</a></li><ul><li><span class="title-icon "></span><a href="#121-top&#x6307;&#x4EE4;&#x67E5;&#x770B;&#xFF1A;"><b></b>1.2.1. top&#x6307;&#x4EE4;&#x67E5;&#x770B;&#xFF1A;</a></li><li><span class="title-icon "></span><a href="#122-&#x6267;&#x884C;&#x65F6;&#x7684;&#x72B6;&#x6001;&#xFF1A;"><b></b>1.2.2. &#x6267;&#x884C;&#x65F6;&#x7684;&#x72B6;&#x6001;&#xFF1A;</a></li></ul><li><span class="title-icon "></span><a href="#13-&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;"><b></b>1.3. &#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;</a></li><ul><li><span class="title-icon "></span><a href="#131-&#x7BA1;&#x9053;"><b></b>1.3.1. &#x7BA1;&#x9053;</a></li><li><span class="title-icon "></span><a href="#132-&#x547D;&#x540D;&#x7BA1;&#x9053;"><b></b>1.3.2. &#x547D;&#x540D;&#x7BA1;&#x9053;</a></li><li><span class="title-icon "></span><a href="#133-&#x6D88;&#x606F;&#x961F;&#x5217;"><b></b>1.3.3. &#x6D88;&#x606F;&#x961F;&#x5217;</a></li><li><span class="title-icon "></span><a href="#134-&#x4FE1;&#x53F7;"><b></b>1.3.4. &#x4FE1;&#x53F7;</a></li><li><span class="title-icon "></span><a href="#135-&#x5171;&#x4EAB;&#x5185;&#x5B58;"><b></b>1.3.5. &#x5171;&#x4EAB;&#x5185;&#x5B58;</a></li><li><span class="title-icon "></span><a href="#136-socket-&#x901A;&#x4FE1;"><b></b>1.3.6. Socket &#x901A;&#x4FE1;</a></li><li><span class="title-icon "></span><a href="#137-&#x4FE1;&#x53F7;&#x91CF;"><b></b>1.3.7. &#x4FE1;&#x53F7;&#x91CF;</a></li></ul><li><span class="title-icon "></span><a href="#14-&#x50F5;&#x5C38;&#x8FDB;&#x7A0B;&#x548C;&#x5B64;&#x513F;&#x8FDB;&#x7A0B;"><b></b>1.4. &#x50F5;&#x5C38;&#x8FDB;&#x7A0B;&#x548C;&#x5B64;&#x513F;&#x8FDB;&#x7A0B;</a></li><li><span class="title-icon "></span><a href="#15-&#x8FDB;&#x7A0B;&#x540C;&#x6B65;"><b></b>1.5. &#x8FDB;&#x7A0B;&#x540C;&#x6B65;</a></li></ul><li><span class="title-icon "></span><a href="#2-&#x7EBF;&#x7A0B;&#x4E0E;&#x8FDB;&#x7A0B;"><b></b>2. &#x7EBF;&#x7A0B;&#x4E0E;&#x8FDB;&#x7A0B;</a></li><li><span class="title-icon "></span><a href="#3-&#x8FDB;&#x7A0B;&#x548C;&#x7A0B;&#x5E8F;"><b></b>3. &#x8FDB;&#x7A0B;&#x548C;&#x7A0B;&#x5E8F;</a></li><li><span class="title-icon "></span><a href="#4-&#x7EBF;&#x7A0B;"><b></b>4. &#x7EBF;&#x7A0B;</a></li><ul><li><span class="title-icon "></span><a href="#41-&#x7EBF;&#x7A0B;&#x7684;&#x610F;&#x4E49;"><b></b>4.1. &#x7EBF;&#x7A0B;&#x7684;&#x610F;&#x4E49;</a></li><li><span class="title-icon "></span><a href="#42-&#x7EBF;&#x7A0B;&#x540C;&#x6B65;"><b></b>4.2. &#x7EBF;&#x7A0B;&#x540C;&#x6B65;</a></li></ul><li><span class="title-icon "></span><a href="#5-&#x5E76;&#x53D1;&#x548C;&#x5E76;&#x884C;"><b></b>5. &#x5E76;&#x53D1;&#x548C;&#x5E76;&#x884C;</a></li></ul></div><a href="#&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 style="font-size:60px;text-align:center;" id="&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;"><a name="&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;" class="anchor-navigation-ex-anchor" href="#&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;</h1>

<h1 id="1-&#x8FDB;&#x7A0B;"><a name="1-&#x8FDB;&#x7A0B;" class="anchor-navigation-ex-anchor" href="#1-&#x8FDB;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x8FDB;&#x7A0B;</h1>
<h2 id="11-&#x7A0B;&#x5E8F;&#x64CD;&#x4F5C;"><a name="11-&#x7A0B;&#x5E8F;&#x64CD;&#x4F5C;" class="anchor-navigation-ex-anchor" href="#11-&#x7A0B;&#x5E8F;&#x64CD;&#x4F5C;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1. &#x7A0B;&#x5E8F;&#x64CD;&#x4F5C;</h2>
<h3 id="111-&#x521B;&#x5EFA;"><a name="111-&#x521B;&#x5EFA;" class="anchor-navigation-ex-anchor" href="#111-&#x521B;&#x5EFA;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.1. &#x521B;&#x5EFA;</h3>
<p>&#x2003;&#x2003;&#x521B;&#x5EFA;&#x7684;&#x662F;&#x539F;&#x8FDB;&#x7A0B;&#x7684;&#x5B50;&#x8FDB;&#x7A0B;&#xFF0C;&#x5B50;&#x8FDB;&#x7A0B;&#x4F1A;&#x590D;&#x5236;&#x7236;&#x8FDB;&#x7A0B;&#x7684;PCB(&#x8FDB;&#x7A0B;&#x63A7;&#x5236;&#x5757;)&#xFF0C;&#x4E8C;&#x8005;&#x4E4B;&#x95F4;&#x4EE3;&#x7801;&#x5171;&#x4EAB;&#xFF0C;&#x6570;&#x636E;&#x72EC;&#x6709;&#xFF0C;&#x62E5;&#x6709;&#x5404;&#x81EA;&#x7684;&#x8FDB;&#x7A0B;&#x865A;&#x62DF;&#x5730;&#x5740;&#x7A7A;&#x95F4;&#x3002;</p>
<pre class="language-"><code class="lang-cpp"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;unistd.h&gt;</span></span>
pid_t <span class="token function">fork</span><span class="token punctuation">(</span><span class="token keyword">void</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<ul>
<li><strong>&#x5199;&#x65F6;&#x62F7;&#x8D1D;&#x6280;&#x672F;</strong> 
  &#x2003;&#x5B50;&#x8FDB;&#x7A0B;&#x521B;&#x5EFA;&#x540E;&#xFF0C;&#x4E0E;&#x7236;&#x8FDB;&#x7A0B;&#x6620;&#x5C04;&#x8BBF;&#x95EE;&#x540C;&#x4E00;&#x5757;&#x7269;&#x7406;&#x5185;&#x5B58;&#xFF0C;&#x5F53;&#x7236;&#x6216;&#x5B50;&#x8FDB;&#x7A0B;&#x5BF9;&#x503C;&#x8FDB;&#x884C;&#x4FEE;&#x6539;&#x65F6;&#xFF0C;&#x4F1A;&#x7ED9;&#x5B50;&#x8FDB;&#x7A0B;&#x91CD;&#x65B0;&#x5728;&#x7269;&#x7406;&#x5185;&#x5B58;&#x4E2D;&#x5F00;&#x8F9F;&#x4E00;&#x5757;&#x7A7A;&#x95F4;&#xFF0C;&#x5E76;&#x5C06;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#x8FC7;&#x53BB;&#x3002;</li>
<li><strong>pid_t</strong>: &#x521B;&#x5EFA;&#x5B50;&#x8FDB;&#x7A0B;&#x5931;&#x8D25;&#xFF0C;&#x4F1A;&#x8FD4;&#x56DE;-1; &#x521B;&#x5EFA;&#x5B50;&#x8FDB;&#x7A0B;&#x6210;&#x529F;&#xFF0C;&#x7236;&#x8FDB;&#x7A0B;&#x8FD4;&#x56DE;pid&#x53F7;&#xFF0C;&#x5B50;&#x8FDB;&#x7A0B;&#x8FD4;&#x56DE;0&#x3002;</li>
</ul>
<h3 id="112-&#x7EC8;&#x6B62;"><a name="112-&#x7EC8;&#x6B62;" class="anchor-navigation-ex-anchor" href="#112-&#x7EC8;&#x6B62;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.2. &#x7EC8;&#x6B62;</h3>
<ul>
<li><strong>&#x6B63;&#x5E38;&#x7EC8;&#x6B62;</strong><ul>
<li>main&#x51FD;&#x6570;&#x8FD4;&#x56DE;</li>
<li>&#x8C03;&#x7528;exit&#x51FD;&#x6570;:  <code>status</code> &#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>wait&#xFF08;int *status&#xFF09;</code> &#x63A5;&#x6536;; <strong>&#x4F1A;&#x5237;&#x65B0;&#x7F13;&#x51B2;</strong> <pre class="language-"><code class="lang-cpp">  <span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;stdlib.h&gt;</span></span>
  <span class="token keyword">void</span> <span class="token function">exit</span><span class="token punctuation">(</span><span class="token keyword">int</span> status<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
</li>
<li>&#x8C03;&#x7528;_exit&#x51FD;&#x6570;:  <code>status</code> &#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>wait&#xFF08;int *status&#xFF09;</code> &#x63A5;&#x6536;;  <strong>&#x4E0D;&#x4F1A;&#x5237;&#x65B0;&#x7F13;&#x51B2;</strong> <pre class="language-"><code class="lang-cpp">  <span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;unistd.h&gt;</span></span>
  <span class="token keyword">void</span> <span class="token function">_exit</span><span class="token punctuation">(</span><span class="token keyword">int</span> status<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
</li>
</ul>
</li>
<li><strong>&#x5F02;&#x5E38;&#x9000;&#x51FA;</strong><ul>
<li>Ctrl+C</li>
<li>&#x88AB;&#x4FE1;&#x53F7;&#x7EC8;&#x6B62;</li>
</ul>
</li>
</ul>
<h3 id="113-&#x7B49;&#x5F85;"><a name="113-&#x7B49;&#x5F85;" class="anchor-navigation-ex-anchor" href="#113-&#x7B49;&#x5F85;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.3. &#x7B49;&#x5F85;</h3>
<p>&#x2003;&#x2003;&#x5982;&#x679C;<strong>&#x5B50;&#x8FDB;&#x7A0B;&#x5148;&#x4E8E;&#x7236;&#x8FDB;&#x7A0B;&#x9000;&#x51FA;</strong>&#xFF0C;&#x800C;&#x7236;&#x8FDB;&#x7A0B;&#x5E76;&#x6CA1;&#x6709;&#x5173;&#x5FC3;&#x5B50;&#x8FDB;&#x7A0B;&#x7684;&#x9000;&#x51FA;&#x72B6;&#x51B5;&#xFF0C;&#x4ECE;&#x800C;&#x65E0;&#x6CD5;&#x56DE;&#x6536;&#x5B50;&#x8FDB;&#x7A0B;&#x7684;&#x8D44;&#x6E90;&#xFF0C;&#x5C31;&#x4F1A;&#x5BFC;&#x81F4;<strong>&#x5B50;&#x8FDB;&#x7A0B;&#x53D8;&#x6210;&#x50F5;&#x5C38;&#x8FDB;&#x7A0B;</strong>&#x3002;<font color="#4c9df8"><strong>&#x8FDB;&#x7A0B;&#x7B49;&#x5F85;&#x7684;&#x4F5C;&#x7528;&#x5C31;&#x662F;&#x7236;&#x8FDB;&#x7A0B;&#x5BF9;&#x5B50;&#x8FDB;&#x7A0B;&#x6536;&#x5C38;&#xFF01;&#x7236;&#x8FDB;&#x7A0B;&#x901A;&#x8FC7;&#x8FDB;&#x7A0B;&#x7B49;&#x5F85;&#x7684;&#x65B9;&#x5F0F;&#xFF0C;&#x56DE;&#x6536;&#x5B50;&#x8FDB;&#x7A0B;&#x7684;&#x8D44;&#x6E90;&#xFF0C;&#x83B7;&#x53D6;&#x5B50;&#x8FDB;&#x7A0B;&#x7684;&#x9000;&#x51FA;&#x72B6;&#x6001;&#x3002;</strong></font></p>
<ul>
<li><p><code>wait</code></p>
<pre class="language-"><code class="lang-cpp">  <span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;sys/types.h&gt;</span></span>
    <span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;sys/wait.h&gt;</span></span>
    pid_t <span class="token function">wait</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">*</span>status<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<ul>
<li><strong>&#x5229;&#x7528;&#x963B;&#x585E;&#xFF0C;&#x7B49;&#x5F85;&#x5B50;&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x3002;</strong></li>
<li><strong>&#x4E00;&#x6B21;&#x53EA;&#x80FD;&#x7B49;&#x5F85;&#x4E00;&#x4E2A;</strong></li>
<li>pid: &#x6210;&#x529F;&#xFF0C;&#x5B50;&#x8FDB;&#x7A0B;&#x7684;pid; &#x5931;&#x8D25;(<strong>&#x6CA1;&#x6709;&#x5B50;&#x8FDB;&#x7A0B;</strong>)&#xFF0C;&#x8FD4;&#x56DE;-1;</li>
<li>status: &#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x4FE1;&#x606F;</li>
</ul>
</li>
<li><p><code>waitpid</code></p>
<pre class="language-"><code class="lang-cpp">  <span class="token comment">//&#x5934;&#x6587;&#x4EF6;&#x540C;wait&#x7684;&#x5934;&#x6587;&#x4EF6;</span>
    pid_t <span class="token function">waitpid</span><span class="token punctuation">(</span>pid_t pid<span class="token punctuation">,</span> <span class="token keyword">int</span> <span class="token operator">*</span>status<span class="token punctuation">,</span> <span class="token keyword">int</span> options<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<ul>
<li>&#x8FD4;&#x56DE;&#x503C;:          <ol>
<li>&#x7B49;&#x5F85;&#x6210;&#x529F;&#xFF0C;&#x8FD4;&#x56DE;pid</li>
<li><strong>options&#x4E3A;WNOHANG&#x65F6;&#xFF0C;&#x6CA1;&#x6709;&#x7B49;&#x5F85;&#x5230;&#x5B50;&#x8FDB;&#x7A0B;&#xFF0C;&#x9A6C;&#x4E0A;&#x9000;&#x51FA;&#x4E0D;&#x963B;&#x585E;&#xFF0C;&#x8FD4;&#x56DE;0</strong></li>
<li>&#x51FA;&#x9519;&#x5219;&#x8FD4;&#x56DE;-1</li>
</ol>
</li>
<li>pid:         <ol>
<li>-1: &#x968F;&#x4FBF;&#x7B49;&#x5F85;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;</li>
<li>pid&#x53F7;: &#x660E;&#x786E;&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x7B49;&#x5F85;</li>
</ol>
</li>
<li>options:<ol>
<li>0: <strong>&#x963B;&#x585E;&#x7B49;&#x5F85;</strong>&#xFF0C;&#x7B49;&#x5F85;&#x5230;&#x4E00;&#x4E2A;&#x5C31;&#x9000;&#x51FA;</li>
<li>WNOHANG: &#x6CA1;&#x6709;&#x7B49;&#x5F85;&#x5230;&#x5B50;&#x8FDB;&#x7A0B;&#xFF0C;&#x9A6C;&#x4E0A;&#x9000;&#x51FA;&#x4E0D;&#x963B;&#x585E;&#xFF0C;&#x8FD4;&#x56DE;0</li>
</ol>
</li>
</ul>
</li>
</ul>
<h3 id="114-&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x4FE1;&#x606F;status"><a name="114-&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x4FE1;&#x606F;status" class="anchor-navigation-ex-anchor" href="#114-&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x4FE1;&#x606F;status"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.4. &#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x4FE1;&#x606F;status</h3>
<ul>
<li><strong>&#x4F4E;16&#x4F4D;&#x5B58;&#x653E;&#x4FE1;&#x606F;&#xFF0C;&#x9AD8;16&#x4F4D;&#x4E0D;&#x7528;</strong></li>
<li><strong>&#x9AD8;8&#x4F4D;</strong> : &#x9000;&#x51FA;&#x7801;&#xFF0C; <code>exit</code> &#x7684;&#x4F20;&#x5165;&#x503C;&#x6216;&#x8005; <code>return</code> &#x503C;<pre class="language-"><code class="lang-cpp">  <span class="token punctuation">(</span>status <span class="token operator">&gt;&gt;</span> <span class="token number">8</span><span class="token punctuation">)</span> <span class="token operator">&amp;</span> <span class="token number">0xFF</span><span class="token punctuation">;</span>
</code></pre>
</li>
<li><strong>&#x4F4E;8&#x4F4D;</strong> : &#x5F02;&#x5E38;&#x9000;&#x51FA;&#x4FE1;&#x606F;<ul>
<li>&#x7B2C;7&#x4F4D;: core dump&#x6807;&#x5FD7;&#x4F4D;;0&#xFF0C;&#x4E0D;&#x4EA7;&#x751F;;1&#xFF0C;&#x4EA7;&#x751F;<pre class="language-"><code class="lang-cpp">  <span class="token punctuation">(</span>status <span class="token operator">&gt;&gt;</span> <span class="token number">7</span><span class="token punctuation">)</span> <span class="token operator">&amp;</span> <span class="token number">0x1</span><span class="token punctuation">;</span>
</code></pre>
</li>
<li>&#x4F4E;7&#x4F4D;: &#x5B50;&#x8FDB;&#x7A0B;&#x662F;&#x5426;&#x5F02;&#x5E38;&#x9000;&#x51FA;;0&#xFF0C;&#x6B63;&#x5E38;;&#x975E;0&#xFF0C;&#x7EC8;&#x6B62;&#x7684;&#x4FE1;&#x53F7;<pre class="language-"><code class="lang-cpp">  status <span class="token operator">&amp;</span> <span class="token number">0x7F</span><span class="token punctuation">;</span>
</code></pre>
</li>
</ul>
</li>
</ul>
<h2 id="12-&#x8FDB;&#x7A0B;&#x72B6;&#x6001;"><a name="12-&#x8FDB;&#x7A0B;&#x72B6;&#x6001;" class="anchor-navigation-ex-anchor" href="#12-&#x8FDB;&#x7A0B;&#x72B6;&#x6001;"><i class="fa fa-link" aria-hidden="true"></i></a>1.2. &#x8FDB;&#x7A0B;&#x72B6;&#x6001;</h2>
<h3 id="121-top&#x6307;&#x4EE4;&#x67E5;&#x770B;&#xFF1A;"><a name="121-top&#x6307;&#x4EE4;&#x67E5;&#x770B;&#xFF1A;" class="anchor-navigation-ex-anchor" href="#121-top&#x6307;&#x4EE4;&#x67E5;&#x770B;&#xFF1A;"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.1. <strong><code>top</code>&#x6307;&#x4EE4;&#x67E5;&#x770B;&#xFF1A;</strong></h3>
<ul>
<li><strong>R (running)</strong>: PCB&#x88AB;&#x653E;&#x5165;CPU&#x7684;&#x53EF;&#x6267;&#x884C;&#x961F;&#x5217;&#x4E2D;;CPU&#x4E0A;&#x6267;&#x884C;&#x7684;RUNNING&#x72B6;&#x6001;&#x3001;&#x800C;&#x5C06;&#x53EF;&#x6267;&#x884C;&#x4F46;&#x662F;&#x5C1A;&#x672A;&#x88AB;&#x8C03;&#x5EA6;&#x6267;&#x884C;&#x7684;READY&#x72B6;&#x6001;</li>
<li><strong>S (sleeping)</strong>: &#x7761;&#x7720;&#x72B6;&#x6001;&#xFF0C;PCB&#x88AB;&#x653E;&#x5165;&#x7B49;&#x5F85;&#x961F;&#x5217;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4E2D;&#x65AD;&#x5524;&#x9192;&#x3002;</li>
<li><strong>D (disk sleep)</strong>:&#x7761;&#x7720;&#x72B6;&#x6001;&#xFF0C;&#x4E0D;&#x80FD;&#x4E2D;&#x65AD;&#x88AB;&#x5524;&#x9192;&#x3002;<strong>&#x5185;&#x6838;&#x7684;&#x67D0;&#x4E9B;&#x5904;&#x7406;&#x6D41;&#x7A0B;&#x662F;&#x4E0D;&#x80FD;&#x88AB;&#x6253;&#x65AD;&#x7684;&#x3002;&#x7528;&#x6765;&#x4FDD;&#x62A4;&#x8FDB;&#x7A0B;&#x3002;</strong></li>
<li><strong>T (stopped)</strong>: SIGSTOP&#x4FE1;&#x53F7;&#x8BA9;&#x8FDB;&#x7A0B;&#x8FDB;&#x5165;&#x6682;&#x505C;&#xFF0C;SIGCONT&#x4FE1;&#x53F7;&#x80FD;&#x5C06;&#x8FDB;&#x7A0B;&#x6062;&#x590D;&#x3002;</li>
<li><strong>t (tracing stop)</strong>: &#x5728;&#x88AB;&#x8FFD;&#x8E2A;&#x65F6;&#xFF0C;&#x8FDB;&#x7A0B;&#x6682;&#x505C;;&#x5178;&#x578B;&#x5E94;&#x7528;&#x5C31;&#x662F; <strong>gdb&#x65AD;&#x70B9;</strong> &#x3002;&#x8C03;&#x8BD5;&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#xFF0C;&#x88AB;&#x8C03;&#x8BD5;&#x7684;&#x8FDB;&#x7A0B;&#x624D;&#x80FD;&#x6062;&#x590D;TASK_RUNNING&#x72B6;&#x6001;&#x3002;</li>
<li><strong>Z (zombie)</strong>: &#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x540E;&#xFF0C;PCB&#x6CA1;&#x6709;&#x88AB;&#x56DE;&#x6536;&#x3002;<font color="#f44336">&#x7236;&#x8FDB;&#x7A0B;&#x6CA1;&#x6709;&#x5BF9;&#x5B50;&#x8FDB;&#x7A0B;&#x6536;&#x5C38;&#xFF0C;&#x5C31;&#x53EA;&#x80FD;&#x7B49;&#x7236;&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x540E;&#xFF0C;&#x8BA9;&#x7237;&#x8FDB;&#x7A0B;&#x6765;&#x7EDF;&#x4E00;&#x6536;&#x5C38;&#x3002;</font></li>
<li><strong>X (dead)</strong>: &#x9A6C;&#x4E0A;&#x4F1A;&#x88AB;&#x5F7B;&#x5E95;&#x9500;&#x6BC1;</li>
</ul>
<h3 id="122-&#x6267;&#x884C;&#x65F6;&#x7684;&#x72B6;&#x6001;&#xFF1A;"><a name="122-&#x6267;&#x884C;&#x65F6;&#x7684;&#x72B6;&#x6001;&#xFF1A;" class="anchor-navigation-ex-anchor" href="#122-&#x6267;&#x884C;&#x65F6;&#x7684;&#x72B6;&#x6001;&#xFF1A;"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.2. <strong>&#x6267;&#x884C;&#x65F6;&#x7684;&#x72B6;&#x6001;&#xFF1A;</strong></h3>
<p>&#x8FDB;&#x7A0B;&#x4E3B;&#x8981;&#x6709;&#x4E09;&#x79CD;&#x72B6;&#x6001;&#xFF1A;<strong>&#x8FD0;&#x884C;&#x6001;&#x3001;&#x5C31;&#x7EEA;&#x6001;&#x3001;&#x963B;&#x585E;&#x6001;&#x3002;</strong></p>
<ul>
<li>&#x300C;&#x8FD0;&#x884C;&#x6001;&#x300D;&#x548C;&#x300C;&#x5C31;&#x7EEA;&#x6001;&#x300D;&#x53EF;&#x4EE5;&#x76F8;&#x4E92;&#x8F6C;&#x6362;&#xFF0C;&#x901A;&#x5E38;&#x7531;&#x7CFB;&#x7EDF;&#x7684;&#x8FDB;&#x7A0B;&#x8C03;&#x5EA6;&#x5F15;&#x8D77;&#x7684;&#x3002;</li>
<li>&#x9047;&#x5230;&#x963B;&#x585E;&#x4EE3;&#x7801;&#xFF0C;&#x8FDB;&#x7A0B;&#x8FDB;&#x5165;&#x300C;&#x963B;&#x585E;&#x6001;&#x300D;&#xFF0C;&#x7B49;&#x5F85;&#x88AB;&#x5524;&#x9192;&#xFF1B;&#x6CA1;&#x6709;&#x8DB3;&#x591F;&#x7684;&#x8FD0;&#x884C;&#x8D44;&#x6E90;&#x65F6;&#xFF0C;&#x8FDB;&#x7A0B;&#x4F1A;&#x88AB;&#x6302;&#x8D77;&#xFF0C;&#x8FDB;&#x5165;&#x300C;&#x963B;&#x585E;&#x6001;&#x300D;&#x7B49;&#x5F85;&#x8D44;&#x6E90;&#x5145;&#x8DB3;&#x3002;</li>
<li>&#x8FDB;&#x7A0B;&#x7531;&#x300C;&#x963B;&#x585E;&#x6001;&#x300D;&#x88AB;&#x5524;&#x9192;&#xFF0C;&#x5C31;&#x4F1A;&#x8FDB;&#x5165;&#x300C;&#x5C31;&#x7EEA;&#x6001;&#x300D;&#xFF0C;&#x7B49;&#x5F85;&#x88AB;&#x8C03;&#x5EA6;&#x3002;</li>
</ul>
<h2 id="13-&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;"><a name="13-&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;" class="anchor-navigation-ex-anchor" href="#13-&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3. &#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;</h2>
<h3 id="131-&#x7BA1;&#x9053;"><a name="131-&#x7BA1;&#x9053;" class="anchor-navigation-ex-anchor" href="#131-&#x7BA1;&#x9053;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.1. &#x7BA1;&#x9053;</h3>
<p>&#x7236;&#x5B50;&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x8BAF;&#x3002;</p>
<h3 id="132-&#x547D;&#x540D;&#x7BA1;&#x9053;"><a name="132-&#x547D;&#x540D;&#x7BA1;&#x9053;" class="anchor-navigation-ex-anchor" href="#132-&#x547D;&#x540D;&#x7BA1;&#x9053;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.2. &#x547D;&#x540D;&#x7BA1;&#x9053;</h3>
<p>&#x53BB;&#x9664;&#x4E86;&#x7236;&#x5B50;&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;&#x7684;&#x673A;&#x5236;&#xFF0C;&#x901A;&#x5E38;&#x7528;&#x6765;&#x6C47;&#x805A;&#x591A;&#x4E2A;&#x5BA2;&#x6237;&#x7AEF;&#x8FDB;&#x7A0B;&#x4E0E;&#x670D;&#x52A1;&#x7AEF;&#x8FDB;&#x7A0B;&#x7684;&#x901A;&#x4FE1;&#x3002;</p>
<h3 id="133-&#x6D88;&#x606F;&#x961F;&#x5217;"><a name="133-&#x6D88;&#x606F;&#x961F;&#x5217;" class="anchor-navigation-ex-anchor" href="#133-&#x6D88;&#x606F;&#x961F;&#x5217;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.3. &#x6D88;&#x606F;&#x961F;&#x5217;</h3>
<p>&#x72EC;&#x7ACB;&#x4E8E;&#x8FDB;&#x7A0B;&#x5B58;&#x5728;&#xFF0C;&#x8FDB;&#x7A0B;&#x95F4;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x6D88;&#x606F;&#x961F;&#x5217;&#x6765;&#x4F20;&#x9012;&#x6570;&#x636E;&#xFF0C;&#x5178;&#x578B;&#x7684;&#x6A21;&#x5F0F;&#x662F;&#x751F;&#x4EA7;&#x8005;-&#x6D88;&#x8D39;&#x8005;&#x6A21;&#x578B;&#x3002;</p>
<h3 id="134-&#x4FE1;&#x53F7;"><a name="134-&#x4FE1;&#x53F7;" class="anchor-navigation-ex-anchor" href="#134-&#x4FE1;&#x53F7;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.4. &#x4FE1;&#x53F7;</h3>
<p>&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x53EF;&#x4EE5;&#x7ED9;&#x53E6;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x53D1;&#x9001;&#x4FE1;&#x53F7;<code>SIGN</code>&#x6765;&#x89E6;&#x53D1;&#x67D0;&#x4E9B;&#x64CD;&#x4F5C;&#x3002;</p>
<h3 id="135-&#x5171;&#x4EAB;&#x5185;&#x5B58;"><a name="135-&#x5171;&#x4EAB;&#x5185;&#x5B58;" class="anchor-navigation-ex-anchor" href="#135-&#x5171;&#x4EAB;&#x5185;&#x5B58;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.5. &#x5171;&#x4EAB;&#x5185;&#x5B58;</h3>
<p><strong>&#x591A;&#x4E2A;&#x8FDB;&#x7A0B;&#x4E0A;&#x4E0D;&#x540C;&#x7684;&#x5730;&#x5740;&#x7A7A;&#x95F4;&#x53EF;&#x4EE5;&#x6620;&#x5C04;&#x5230;&#x540C;&#x4E00;&#x5757;&#x7269;&#x7406;&#x5185;&#x5B58;&#x4E0A;&#xFF0C;&#x5B9E;&#x73B0;&#x6570;&#x636E;&#x7684;&#x5171;&#x4EAB;</strong>&#x3002;&#x56E0;&#x4E3A;&#x4E0D;&#x6D89;&#x53CA;&#x6570;&#x636E;&#x7684;&#x62F7;&#x8D1D;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;&#x662F;&#x4E00;&#x79CD;&#x9AD8;&#x6548;&#x7684;&#x901A;&#x4FE1;&#x65B9;&#x5F0F;&#x3002;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;&#x591A;&#x4E2A;&#x8FDB;&#x7A0B;&#x5E76;&#x884C;&#x65F6;&#xFF0C;&#x9700;&#x8981;&#x901A;&#x8FC7;&#x540C;&#x6B65;&#x673A;&#x5236;&#x4FDD;&#x62A4;&#x5171;&#x4EAB;&#x5185;&#x5B58;&#x7684;&#x8BBF;&#x95EE;&#x3002;</p>
<h3 id="136-socket-&#x901A;&#x4FE1;"><a name="136-socket-&#x901A;&#x4FE1;" class="anchor-navigation-ex-anchor" href="#136-socket-&#x901A;&#x4FE1;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.6. Socket &#x901A;&#x4FE1;</h3>
<p>&#x8C03;&#x7528;<code>TCP</code>&#x4E0E;<code>UDP</code>&#x8FDB;&#x884C;&#x901A;&#x8BAF;&#x3002;</p>
<h3 id="137-&#x4FE1;&#x53F7;&#x91CF;"><a name="137-&#x4FE1;&#x53F7;&#x91CF;" class="anchor-navigation-ex-anchor" href="#137-&#x4FE1;&#x53F7;&#x91CF;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.7. &#x4FE1;&#x53F7;&#x91CF;</h3>
<p>&#x7528;&#x6765;&#x7EDF;&#x8BA1;&#x8D44;&#x6E90;&#x6570;&#x91CF;&#x7684;&#x3002;</p>
<ul>
<li><strong>&#x6574;&#x578B;&#x4FE1;&#x53F7;&#x91CF;</strong><ul>
<li><code>0</code>: &#x7E41;&#x5FD9;&#xFF0C;&#x6CA1;&#x6709;&#x8D44;&#x6E90;&#x53EF;&#x7528;&#x3002;</li>
<li><code>&gt; 0</code>: &#x8D44;&#x6E90;&#x6709;&#x7A7A;&#x95F2;&#x3002;</li>
<li><span style="color:red;font-weight:bold"> &#x4E0D;&#x80FD;&#x4E3A;&#x8D1F;&#x503C; </span></li>
</ul>
</li>
<li><strong>&#x8BB0;&#x5F55;&#x578B;&#x4FE1;&#x53F7;&#x91CF;</strong><ul>
<li><code>0</code>: &#x7E41;&#x5FD9;&#xFF0C;&#x6CA1;&#x6709;&#x8D44;&#x6E90;&#x53EF;&#x7528;&#xFF0C;<strong>&#x4E5F;&#x6CA1;&#x6709;&#x4EBA;&#x8FC7;&#x6765;&#x7B49;&#x5F85;&#x8D44;&#x6E90;&#x3002;</strong></li>
<li><code>&gt; 0</code>: &#x8D44;&#x6E90;&#x6709;&#x7A7A;&#x95F2;&#x3002;</li>
<li><code>&lt; 0</code>: &#x6CA1;&#x8D44;&#x6E90;&#xFF0C;<strong>&#x7B49;&#x5F85;&#x961F;&#x5217;&#x4E0B;&#x6709;&#x4EBA;&#x5728;&#x90A3;&#x513F;&#x7B49;&#x7740;&#x3002;</strong></li>
</ul>
</li>
</ul>
<h2 id="14-&#x50F5;&#x5C38;&#x8FDB;&#x7A0B;&#x548C;&#x5B64;&#x513F;&#x8FDB;&#x7A0B;"><a name="14-&#x50F5;&#x5C38;&#x8FDB;&#x7A0B;&#x548C;&#x5B64;&#x513F;&#x8FDB;&#x7A0B;" class="anchor-navigation-ex-anchor" href="#14-&#x50F5;&#x5C38;&#x8FDB;&#x7A0B;&#x548C;&#x5B64;&#x513F;&#x8FDB;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>1.4. &#x50F5;&#x5C38;&#x8FDB;&#x7A0B;&#x548C;&#x5B64;&#x513F;&#x8FDB;&#x7A0B;</h2>
<ul>
<li><strong>&#x50F5;&#x5C38;&#x8FDB;&#x7A0B;&#xFF1A;</strong> &#x7236;&#x8FDB;&#x7A0B;&#x8FD0;&#x884C;&#x5B8C;&#x6BD5;&#xFF0C;&#x6CA1;&#x6709;&#x5BF9;&#x300C;&#x5DF2;&#x7ECF;&#x9000;&#x51FA;&#x7684;&#x5B50;&#x8FDB;&#x7A0B;&#x300D;&#x8FDB;&#x884C;&#x6536;&#x5C38;&#x3002;</li>
<li><strong>&#x5B64;&#x513F;&#x8FDB;&#x7A0B;&#xFF1A;</strong> &#x5F53;&#x7236;&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x4E86;&#xFF0C;&#x4F46;&#x662F;&#x5B83;&#x7684;&#x300C;&#x5B50;&#x8FDB;&#x7A0B;&#x8FD8;&#x6CA1;&#x6709;&#x9000;&#x51FA;&#x300D;&#xFF0C;&#x8FD9;&#x4E9B;&#x5B50;&#x8FDB;&#x7A0B;&#x5C31;&#x53D8;&#x6210;&#x4E86;&#x5B64;&#x513F;&#x8FDB;&#x7A0B;&#x3002;<strong>&#x5B64;&#x513F;&#x8FDB;&#x7A0B;&#x53EA;&#x662F;&#x6682;&#x65F6;&#x7684;</strong>&#xFF0C;&#x7CFB;&#x7EDF;&#x4F1A;&#x5728;&#x7236;&#x8FDB;&#x7A0B;&#x9000;&#x51FA;&#x65F6;&#x542F;&#x52A8;<strong>&#x5BFB;&#x7236;&#x673A;&#x5236;</strong>&#xFF0C;&#x4E3A;&#x5B50;&#x8FDB;&#x7A0B;&#x627E;&#x5230;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x7236;&#x4EB2;&#x3002;</li>
</ul>
<h2 id="15-&#x8FDB;&#x7A0B;&#x540C;&#x6B65;"><a name="15-&#x8FDB;&#x7A0B;&#x540C;&#x6B65;" class="anchor-navigation-ex-anchor" href="#15-&#x8FDB;&#x7A0B;&#x540C;&#x6B65;"><i class="fa fa-link" aria-hidden="true"></i></a>1.5. &#x8FDB;&#x7A0B;&#x540C;&#x6B65;</h2>
<p><strong>&#x8FDB;&#x7A0B;&#x540C;&#x6B65;&#xFF1A;</strong> &#x8FDB;&#x7A0B;&#x540C;&#x6B65;&#x662F;&#x6307;&#x63A7;&#x5236;&#x8FDB;&#x7A0B;&#x6309;&#x7167;&#x4E00;&#x5B9A;&#x987A;&#x5E8F;&#x6267;&#x884C;&#x3002;&#x53EA;&#x6709;&#x5904;&#x4E8E;<strong>&#x4E34;&#x754C;&#x533A;</strong>&#xFF08;&#x6307;&#x8BBF;&#x95EE;&#x5171;&#x4EAB;&#x5185;&#x5B58;&#x7684;&#x4EE3;&#x7801;&#x7247;&#x6BB5;&#xFF09;&#x7684;&#x8FDB;&#x7A0B;&#x624D;&#x9700;&#x8981;&#x540C;&#x6B65;&#x3002;</p>
<ul>
<li><strong>&#x5FD9;&#x7B49;&#x5F85;&#x4E92;&#x65A5;&#xFF08;&#x81EA;&#x65CB;&#x9501;&#xFF09;&#xFF1A;</strong>&#x5F53;&#x67D0;&#x4E2A;&#x53D8;&#x91CF;&#x4E0D;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x65F6;&#xFF0C;&#x4F1A;&#x4E00;&#x76F4;&#x8F6E;&#x8BE2;&#x76F4;&#x5230;&#x53D8;&#x91CF;&#x503C;&#x53D1;&#x9001;&#x6539;&#x53D8;&#x3002;&#x7528;&#x4E8E;&#x5FD9;&#x7B49;&#x5F85;&#x7684;&#x9501;&#x79F0;&#x4E3A;<strong>&#x81EA;&#x65CB;&#x9501;</strong>&#x3002;</li>
<li><strong>&#x4FE1;&#x53F7;&#x91CF;&#xFF1A;</strong> &#x662F;&#x4E00;&#x4E2A;&#x6574;&#x578B;&#x53D8;&#x91CF;&#xFF0C;&#x7528;&#x6765;&#x5B9E;&#x73B0;&#x8BA1;&#x6570;&#x5668;&#x529F;&#x80FD;&#xFF0C;&#x4E3B;&#x8981;&#x63D0;&#x4F9B; <code>down</code> &#x548C; <code>up</code> &#x64CD;&#x4F5C;&#xFF08;&#x5373; <code>P</code> &#x548C; <code>V</code> &#x64CD;&#x4F5C;&#xFF09;&#xFF0C;&#x8FD9;&#x4E24;&#x4E2A;&#x64CD;&#x4F5C;&#x90FD;&#x662F;&#x539F;&#x5B50;&#x6027;&#x7684;&#x3002;&#x5F53;&#x6267;&#x884C; <code>down</code> &#x64CD;&#x4F5C;&#x4F7F;&#x4FE1;&#x53F7;&#x91CF;&#x503C;&#x53D8;&#x4E3A; <code>0</code> &#x65F6;&#xFF0C;&#x4F1A;&#x5BFC;&#x81F4;&#x5F53;&#x524D;&#x8FDB;&#x7A0B;&#x7761;&#x7720;&#xFF0C;&#x800C;&#x6267;&#x884C; <code>up</code> &#x64CD;&#x4F5C; <code>+1</code> &#x65F6;&#xFF0C;&#x4F1A;&#x540C;&#x65F6;&#x5524;&#x9192;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x3002;</li>
<li><strong>&#x7BA1;&#x7A0B;&#xFF1A;</strong> &#x7BA1;&#x7A0B;&#x662F;&#x7531;&#x4E00;&#x4E2A;&#x8FC7;&#x7A0B;&#x3001;&#x53D8;&#x91CF;&#x548C;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x7EC4;&#x6210;&#x7684;&#x4E00;&#x4E2A;&#x96C6;&#x5408;&#xFF0C;&#x628A;&#x9700;&#x8981;&#x63A7;&#x5236;&#x7684;&#x90A3;&#x90E8;&#x5206;&#x4EE3;&#x7801;&#x72EC;&#x7ACB;&#x51FA;&#x6765;&#x6267;&#x884C;&#xFF0C;&#x5B83;&#x6709;&#x4E00;&#x4E2A;&#x91CD;&#x8981;&#x7684;&#x7279;&#x6027;&#xFF0C;&#x540C;&#x4E00;&#x65F6;&#x523B;&#x5728;&#x7BA1;&#x7A0B;&#x4E2D;&#x53EA;&#x80FD;&#x6709;&#x4E00;&#x4E2A;&#x6D3B;&#x8DC3;&#x7684;&#x8FDB;&#x7A0B;&#x3002;&#x4E3A;&#x4E86;&#x907F;&#x514D;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x4E00;&#x76F4;&#x5360;&#x7528;&#x7BA1;&#x7A0B;&#xFF0C;&#x5F15;&#x5165;&#x4E86;&#x6761;&#x4EF6;&#x53D8;&#x91CF;&#x548C; wait &#x548C; signal &#x64CD;&#x4F5C;&#x3002;&#x5F53;&#x53D1;&#x751F;&#x5F53;&#x524D;&#x8FDB;&#x7A0B;&#x65E0;&#x6CD5;&#x8FD0;&#x884C;&#x65F6;&#xFF0C;&#x6267;&#x884C; wait &#x64CD;&#x4F5C;&#xFF0C;&#x5C06;&#x5F53;&#x524D;&#x8FDB;&#x7A0B;&#x963B;&#x585E;&#xFF0C;&#x540C;&#x65F6;&#x8C03;&#x5165;&#x5728;&#x7BA1;&#x7A0B;&#x5916;&#x7B49;&#x5F85;&#x7684;&#x53E6;&#x4E00;&#x8FDB;&#x7A0B;&#x6267;&#x884C;&#xFF0C;&#x800C;&#x53E6;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x53D8;&#x91CF;&#x65F6;&#xFF0C;&#x4F1A;&#x6267;&#x884C; signal &#x64CD;&#x4F5C;&#x5C06;&#x6B63;&#x5728;&#x7761;&#x7720;&#x7684;&#x8FDB;&#x7A0B;&#x5524;&#x9192;&#xFF0C;&#x7136;&#x540E;&#x9A6C;&#x4E0A;&#x9000;&#x51FA;&#x7BA1;&#x7A0B;&#x3002;</li>
<li><strong>&#x6539;&#x9020;&#x7EBF;&#x7A0B;&#x4E92;&#x65A5;&#x9501;&#xFF1A;</strong> <span style="color:red;font-weight:bold"> &#x8FD9;&#x4E2A;&#x5F97;&#x770B;&#x7CFB;&#x7EDF;&#x652F;&#x4E0D;&#x652F;&#x6301;&#x3002; </span></li>
</ul>
<h1 id="2-&#x7EBF;&#x7A0B;&#x4E0E;&#x8FDB;&#x7A0B;"><a name="2-&#x7EBF;&#x7A0B;&#x4E0E;&#x8FDB;&#x7A0B;" class="anchor-navigation-ex-anchor" href="#2-&#x7EBF;&#x7A0B;&#x4E0E;&#x8FDB;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x7EBF;&#x7A0B;&#x4E0E;&#x8FDB;&#x7A0B;</h1>
<p><strong>&#x7EBF;&#x7A0B;</strong>&#xFF1A;&#x8FDB;&#x7A0B;&#x4E2D;&#x6D3B;&#x52A8;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x662F;<code>CPU</code>&#x8C03;&#x5EA6;&#x548C;&#x5206;&#x6D3E;&#x7684;&#x57FA;&#x672C;&#x5355;&#x4F4D;&#x3002;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x53EF;&#x4EE5;&#x7531;&#x5F88;&#x591A;&#x4E2A;&#x7EBF;&#x7A0B;&#x7EC4;&#x6210;&#xFF0C;&#x7EBF;&#x7A0B;&#x95F4;&#x5171;&#x4EAB;&#x8FDB;&#x7A0B;&#x7684;&#x6240;&#x6709;&#x8D44;&#x6E90;&#xFF0C;&#x6BCF;&#x4E2A;&#x7EBF;&#x7A0B;&#x4F1A;&#x7EF4;&#x62A4;&#x81EA;&#x5DF1;&#x7684;&#x5806;&#xFF0C;&#x6808;&#x548C;&#x5BC4;&#x5B58;&#x5668;&#x503C;&#x3002;&#x7EBF;&#x7A0B;&#x7531;<code>CPU</code>&#x72EC;&#x7ACB;&#x8C03;&#x5EA6;&#x6267;&#x884C;&#xFF0C;&#x5728;&#x591A;<code>CPU</code>&#x73AF;&#x5883;&#x4E0B;&#x5C31;&#x5141;&#x8BB8;&#x591A;&#x4E2A;&#x7EBF;&#x7A0B;&#x540C;&#x65F6;&#x8FD0;&#x884C;&#x3002;</p>
<p><strong>&#x8FDB;&#x7A0B;</strong>: &#x8D44;&#x6E90;&#x5206;&#x914D;&#x7684;&#x57FA;&#x672C;&#x5355;&#x4F4D;&#xFF0C;&#x7A0B;&#x5E8F;&#x6267;&#x884C;&#x65F6;&#x7684;&#x4E00;&#x4E2A;&#x5B9E;&#x4F8B;&#x3002;&#x7A0B;&#x5E8F;&#x8FD0;&#x884C;&#x65F6;&#x7CFB;&#x7EDF;&#x5C31;&#x4F1A;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#xFF0C;&#x5E76;&#x4E3A;&#x5B83;&#x5206;&#x914D;&#x8D44;&#x6E90;&#xFF0C;&#x7136;&#x540E;&#x628A;&#x8BE5;&#x8FDB;&#x7A0B;&#x653E;&#x5165;&#x8FDB;&#x7A0B;&#x300C;&#x5C31;&#x7EEA;&#x961F;&#x5217;&#x300D;&#xFF0C;&#x8FDB;&#x7A0B;&#x8C03;&#x5EA6;&#x5668;&#x9009;&#x4E2D;&#x5B83;&#x7684;&#x65F6;&#x5019;&#x5C31;&#x4F1A;&#x4E3A;&#x5B83;&#x5206;&#x914D;<code>CPU</code>&#x65F6;&#x95F4;&#xFF0C;&#x7A0B;&#x5E8F;&#x5F00;&#x59CB;&#x771F;&#x6B63;&#x8FD0;&#x884C;&#x3002;</p>
<h1 id="3-&#x8FDB;&#x7A0B;&#x548C;&#x7A0B;&#x5E8F;"><a name="3-&#x8FDB;&#x7A0B;&#x548C;&#x7A0B;&#x5E8F;" class="anchor-navigation-ex-anchor" href="#3-&#x8FDB;&#x7A0B;&#x548C;&#x7A0B;&#x5E8F;"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x8FDB;&#x7A0B;&#x548C;&#x7A0B;&#x5E8F;</h1>
<ul>
<li>&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x662F;&#x7A0B;&#x5E8F;&#x6267;&#x884C;&#x65F6;&#x7684;&#x4E00;&#x4E2A;&#x5B9E;&#x4F8B;&#xFF0C;&#x4E00;&#x4E2A;&#x7A0B;&#x5E8F;&#x53EF;&#x4EE5;&#x5BF9;&#x5E94;&#x591A;&#x4E2A;&#x8FDB;&#x7A0B;&#xFF0C;&#x4F46;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x53EA;&#x80FD;&#x5BF9;&#x5E94;&#x4E00;&#x4E2A;&#x7A0B;&#x5E8F;&#x3002;</li>
<li>&#x8FDB;&#x7A0B;&#x662F;&#x52A8;&#x6001;&#x7684;&#xFF0C;&#x800C;&#x7A0B;&#x5E8F;&#x662F;&#x9759;&#x6001;&#x7684;&#x3002;</li>
<li>&#x8FDB;&#x7A0B;&#x6709;&#x4E00;&#x5B9A;&#x7684;&#x751F;&#x547D;&#x671F;&#xFF0C;&#x800C;&#x7A0B;&#x5E8F;&#x662F;&#x6307;&#x4EE4;&#x7684;&#x96C6;&#x5408;&#xFF0C;&#x672C;&#x8EAB;&#x65E0;&#x8FD0;&#x52A8;&#x7684;&#x542B;&#x4E49;&#x3002;</li>
</ul>
<h1 id="4-&#x7EBF;&#x7A0B;"><a name="4-&#x7EBF;&#x7A0B;" class="anchor-navigation-ex-anchor" href="#4-&#x7EBF;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x7EBF;&#x7A0B;</h1>
<h2 id="41-&#x7EBF;&#x7A0B;&#x7684;&#x610F;&#x4E49;"><a name="41-&#x7EBF;&#x7A0B;&#x7684;&#x610F;&#x4E49;" class="anchor-navigation-ex-anchor" href="#41-&#x7EBF;&#x7A0B;&#x7684;&#x610F;&#x4E49;"><i class="fa fa-link" aria-hidden="true"></i></a>4.1. &#x7EBF;&#x7A0B;&#x7684;&#x610F;&#x4E49;</h2>
<ul>
<li>&#x5728;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x4E2D;&#x4F1A;&#x5B58;&#x5728;&#x591A;&#x79CD;&#x6D3B;&#x52A8;&#x4EFB;&#x52A1;&#xFF0C;&#x9700;&#x8981;&#x6709;&#x591A;&#x4E2A;&#x72EC;&#x7ACB;&#x8C03;&#x5EA6;&#x7684;&#x5355;&#x5143;&#x6765;&#x4F7F;&#x8FD9;&#x4E9B;&#x4EFB;&#x52A1;&#x53EF;&#x4EE5;&#x5E76;&#x884C;&#x7684;&#x6267;&#x884C;&#xFF0C;&#x8FD9;&#x4E9B;&#x5355;&#x5143;&#x5C31;&#x662F;&#x7EBF;&#x7A0B;&#x3002;</li>
<li>&#x7EBF;&#x7A0B;&#x6BD4;&#x8FDB;&#x7A0B;&#x66F4;&#x8F7B;&#x91CF;&#xFF0C;&#x5B83;&#x4EEC;&#x6BD4;&#x8FDB;&#x7A0B;&#x66F4;&#x5FEB;&#x7684;&#x521B;&#x5EFA;&#xFF0C;&#x4E5F;&#x66F4;&#x5BB9;&#x6613;&#x64A4;&#x9500;&#x3002;<strong>&#x7EBF;&#x7A0B;&#x95F4;&#x5207;&#x6362;&#x7684;&#x5F00;&#x9500;&#x4E5F;&#x6BD4;&#x8FDB;&#x7A0B;&#x5C0F;</strong>&#xFF0C;&#x7531;&#x4E8E;&#x8FDB;&#x7A0B;&#x62E5;&#x6709;&#x5927;&#x91CF;&#x7684;&#x8D44;&#x6E90;&#xFF0C;&#x5F53;&#x5207;&#x6362;&#x5230;&#x53E6;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x9700;&#x8981;&#x4FDD;&#x5B58;&#x5F53;&#x524D;&#x8FDB;&#x7A0B;&#x7684;&#x6240;&#x6709;&#x8D44;&#x6E90;&#xFF0C;&#x800C;<strong>&#x7EBF;&#x7A0B;&#x95F4;&#x7684;&#x5207;&#x6362;&#x53EA;&#x9700;&#x8981;&#x4FDD;&#x5B58;&#x5F53;&#x524D;&#x5806;&#x6808;&#x548C;&#x76F8;&#x5E94;&#x5BC4;&#x5B58;&#x5668;&#x7684;&#x5185;&#x5BB9;&#x3002;</strong></li>
</ul>
<h2 id="42-&#x7EBF;&#x7A0B;&#x540C;&#x6B65;"><a name="42-&#x7EBF;&#x7A0B;&#x540C;&#x6B65;" class="anchor-navigation-ex-anchor" href="#42-&#x7EBF;&#x7A0B;&#x540C;&#x6B65;"><i class="fa fa-link" aria-hidden="true"></i></a>4.2. &#x7EBF;&#x7A0B;&#x540C;&#x6B65;</h2>
<ul>
<li><strong>&#x4E92;&#x65A5;&#x9501;&#xFF1A;</strong> <code>pthread_mutex_</code>&#x90A3;&#x4E00;&#x5957;</li>
<li><strong>&#x6761;&#x4EF6;&#x91CF;&#xFF1A;</strong> &#x5F15;&#x5165;&#x4FE1;&#x53F7;&#x673A;&#x5236;&#xFF0C;&#x4F18;&#x5316;&#x540E;&#x7684;&#x62A2;&#x9501;&#x673A;&#x5236;&#x3002;</li>
<li><strong>&#x4FE1;&#x53F7;&#x91CF;&#xFF1A;</strong> &#x540C;&#x8FDB;&#x7A0B;&#x3002;</li>
<li><strong>&#x81EA;&#x65CB;&#x9501;&#xFF1A;</strong> &#x540C;&#x8FDB;&#x7A0B;&#x3002;</li>
</ul>
<h1 id="5-&#x5E76;&#x53D1;&#x548C;&#x5E76;&#x884C;"><a name="5-&#x5E76;&#x53D1;&#x548C;&#x5E76;&#x884C;" class="anchor-navigation-ex-anchor" href="#5-&#x5E76;&#x53D1;&#x548C;&#x5E76;&#x884C;"><i class="fa fa-link" aria-hidden="true"></i></a>5. &#x5E76;&#x53D1;&#x548C;&#x5E76;&#x884C;</h1>
<p><strong>&#x5E76;&#x53D1;&#xFF1A;</strong> &#x4E00;&#x6BB5;&#x65F6;&#x95F4;&#x5185;&#x53EF;&#x4EE5;&#x540C;&#x65F6;&#x8FD0;&#x884C;&#x591A;&#x9053;&#x7A0B;&#x5E8F;&#xFF0C;&#x5BF9;&#x4E8E;CPU&#x800C;&#x8A00;&#x5C31;&#x662F;&#x7A0B;&#x5E8F;&#x6765;&#x56DE;&#x5207;&#x6362;&#x3002;
<strong>&#x5E76;&#x884C;&#xFF1A;</strong> &#x591A;&#x4E2A;CPU&#x540C;&#x65F6;&#x8FD0;&#x884C;&#x7A0B;&#x5E8F;&#xFF0C;&#x771F;&#x6B63;&#x7269;&#x7406;&#x4E0A;&#x7684;&#x5E76;&#x53D1;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="memory_withNum.html" class="navigation navigation-prev " aria-label="Previous page: 五、内存">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="locks_withNum.html" class="navigation navigation-next " aria-label="Next page: 七、锁">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"六、进程与线程","level":"2.1.6","depth":2,"next":{"title":"七、锁","level":"2.1.7","depth":2,"path":"cpp/chapter/locks_withNum.md","ref":"cpp/chapter/locks_withNum.md","articles":[]},"previous":{"title":"五、内存","level":"2.1.5","depth":2,"path":"cpp/chapter/memory_withNum.md","ref":"cpp/chapter/memory_withNum.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","search-pro-fixed","expandable-chapters-small","ancre-navigation","hide-element","code","splitter","insert-logo-link-website","-sharing","sharing-plus","prism","-highlight","flexible-alerts","lightbox","pageview-count","auto-scroll-table","katex-pro","favicon-absolute","sectionx","terminull-light","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-tomorrow.css"],"lang":{"flow":"typescript"}},"livereload":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"auto-scroll-table":{},"code":{"copyButtons":true},"terminull-light":{},"search-pro-fixed":{},"favicon-absolute":{"favicon":"image/ico.png","appleTouchIconPrecomposed152":"image/ico.png","appleTouchIconMore":{},"appleTouchIconPrecomposedMore":{}},"hide-element":{"elements":[".gitbook-link"]},"katex-pro":{},"fontsettings":{"theme":"white","family":"sans","size":2},"sectionx":{"tag":"b"},"lightbox":{"jquery":true,"sameUuid":false},"insert-logo-link-website":{"url":"image/logo.png","link":"https://space.bilibili.com/27206875","target":"_blank","style":"height: 230px"},"pageview-count":{},"ancre-navigation":{"showLevel":true,"associatedWithSummary":true,"mode":"float","printLog":false,"multipleH1":true,"float":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""},"pageTop":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""}},"expandable-chapters-small":{},"flexible-alerts":{"style":"callout","note":{"label":"Note","icon":"fa fa-info-circle","className":"info"},"tip":{"label":"Tip","icon":"fa fa-lightbulb-o","className":"tip"},"warning":{"label":"Warning","icon":"fa fa-exclamation-triangle","className":"warning"},"danger":{"label":"Attention","icon":"fa fa-ban","className":"danger"}},"sharing":{"qq":true,"all":["douban","facebook","google","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","whatsapp"],"douban":false,"facebook":false,"weibo":true,"whatsapp":false,"twitter":false,"pocket":false,"google":true,"qzone":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"海拉尔的三角","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"计算机笔记","links":{"sidebar":{"Github":"https://github.com/spite-triangle"}},"gitbook":"*"},"file":{"path":"cpp/chapter/process_withNum.md","mtime":"2021-09-14T15:43:12.857Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-09-14T15:43:23.052Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro-fixed/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro-fixed/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-insert-logo-link-website/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-auto-scroll-table/plugin.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-terminull-light/terminull.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

